package com.ncmmall.domain.business.goods.collect;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ncmmall.domain.business.goods.Goods;
import com.ncmmall.domain.security.user.WebUser;

import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import java.sql.Timestamp;

/**
 * 商品收藏
 *
 * @author likaikai
 * @date 2019-07-15 11:01
 */

@Entity
@Table(name = "mall_goods_collect")
@Access(AccessType.FIELD)
public class GoodsCollect {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;

    /**
     * 会员
     */
    @OneToOne
    private WebUser member;

    /**
     * 商品
     */
    @OneToOne
    private Goods goods;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Timestamp createTime;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public WebUser getMember() {
        return member;
    }

    public void setMember(WebUser member) {
        this.member = member;
    }

    public Goods getGoods() {
        return goods;
    }

    public void setGoods(Goods goods) {
        this.goods = goods;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }
}
